#============================================================
#	Collision
#============================================================
# @datetime: 2022-4-21 20:14:26
#============================================================
class_name EnemyCollision
extends Node2D


onready var detect_player := $Direction/DetectPlayer as DetectBody
onready var _no_way : RayCast2D = get_node("Direction/NoWay")


#============================================================
#   内置
#============================================================
func _ready():
	# 设置检测到的节点的条件
	detect_player.add_exception(owner)
	detect_player.set_condition(self, "is_player")
	# 射线排除的节点
	_no_way.add_exception(owner)


#============================================================
#   Set/Get
#============================================================
func is_player(body) -> bool:
	return body is Player

